from flask import Flask, request, jsonify

from txt_api.pd_desc import get_product_desc_from_ollama
app = Flask(__name__)

@app.route('/get_pd_info_om', methods=['GET'])
def get_pd_info_om():
    # 从 URL 中获取参数
    keywords = request.args.get('keywords')
    print(keywords)
    pd_json = get_product_desc_from_ollama(keywords)
    return pd_json

if __name__ == '__main__':
    app.run(debug=True, host= '0.0.0.0', port=5000)
